//
//  CitySinceViewController.m
//  DZZTravel
//
//  Created by 赵国栋 on 16/7/14.
//  Copyright © 2016年 Eason. All rights reserved.
//

#import "CitySinceViewController.h"

@interface CitySinceViewController ()

@end

@implementation CitySinceViewController


- (void)viewDidLoad {
    [super viewDidLoad];
    
    [self requestData];

    
    // Do any additional setup after loading the view from its nib.
}



- (void)requestData{
    
    [RequestManager fectDataWithUrl:[NSString stringWithFormat:@"http://apiphp.yaochufa.com/portal/scenic/ScenicDetail430?channel=AppStore&id=%@&imei=3BB694A0-037E-406A-8F2B-0852448416B6&lang=app&machineCode=3BB694A0-037E-406A-8F2B-0852448416B6&machineType=0&system=ios&version=5.2.3",self.city.scenicId] parameter:@{} method:@"GET" compelet:^(NSData *data) {
        NSDictionary *dic = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingAllowFragments error:nil];
        
       
         [self.headPic sd_setImageWithURL:[NSURL URLWithString:dic[@"content"][@"coverPic"]]];
        //景区标题
        [self.headTitle setTitle:dic[@"content"][@"cityName"] forState:UIControlStateNormal];
        //开放时间
        self.openTime.text = dic[@"content"][@"openTime"];
        //景区地址
        [self.sinceAdress setTitle:dic[@"content"][@"address"] forState:UIControlStateNormal];
        
        [self.centerPic sd_setImageWithURL:[NSURL URLWithString:dic[@"content"][@"hotRecommendation"][@"mImageUrl"]]];
        
        self.centerTalk.text =dic[@"content"][@"hotRecommendation"][@"productDescription"];
        
        NSArray *array =dic[@"content"][@"product"];
        NSArray *array1 =  array[0][@"product"];
        NSDictionary *dicc = array1[1];
        
        [self.bottomPic sd_setImageWithURL:[NSURL URLWithString:dicc[@"mImageUrl"]]];
        
        self.bottomTalk.text =dicc[@"productDescription"];
        
       
    } upDateUI:^{
        
       
 
    }];
}




- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}


@end
